<template>

  <div class="home">
    <div id="indexQukuanedu">
      <header>
        <img src="../assets/fanhui.png" alt="" onclick="history.go(-1)">
        <p>取点花额度</p>
        <!--<img src="../assets/weiti.png" alt="" @click="CommonProblem()">-->
        <p></p>
      </header>
      <div class="AvailableCredit">
        <div class="AvailableCredit_infor">
          <p>可用额度(元)</p>
          <p>{{audit_amount}}</p>
        </div>
        <div id="TotalAmount">
          <p>总额度 <span id="TotalAmountMoney">{{audit_limit}}</span>元 <span>{{temp_credit_tip}}</span></p>
        </div>
      </div>

      <div class="ApplicationLimitMomey">
        <ul>
          <li>
            <p>申请临时额度</p>
            <p>免材料 免审核</p>
          </li>
          <li id="limitTrans" @click="limitTrans()">
            <p>当前可提 ￥<span>{{raise_amount}}</span> <img src="../assets/gengduo.png" alt=""></p>
          </li>
        </ul>
      </div>


      <div id="divs" v-show="customMoneyShow">

        <div class="ShowWarn" v-show="CreditAssessmentFee">
          <p>提示</p>
          <p style="line-height: 2rem;margin-top: -2rem">取点花提醒您理性消费，请按时还款<br>后续恢复提额条件时，我们将<br>第一时间通知您！</p>
          <p @click="RationalConsumption()">确定</p>
        </div>

      </div>



      </div>


  </div>
</template>

<script>

  import axios from 'axios'

  export default {

    name:'temporaryLimit',

    data() {
      return {
        temporaryLimitTocken:'',
        audit_amount:'',
        audit_limit:'',
        raise_amount:'',
        temp_credit_tip:'',
        message:'temporaryLimit',
        customMoneyShow:false,
        CreditAssessmentFee:true

      }
    },
    created() {
      var that = this;
      that.temporaryLimitTocken = sessionStorage.getItem('AuthToken');
      axios.get('http://test.zjapi.xianxiangle.com/credit_show?AuthToken=' + that.temporaryLimitTocken).then(function (res) {
        console.log(res.data.data);
        that.audit_amount=res.data.data.audit_amount;
        that.audit_limit=res.data.data.audit_limit;
        that.raise_amount=res.data.data.raise_amount;
        that.temp_credit_tip=res.data.data.temp_credit_tip;
      }).catch(function (err) {

      })
    },
    methods: {
      limitTrans() {
        var that=this;
        if(that.raise_amount!==0){
          that.$router.push({path:'/PromoteLimit',query:{raise_amount:that.raise_amount}})
        }else {
          that.customMoneyShow=true
        }
      },
      RationalConsumption(){
        this.customMoneyShow=false
      },
      // show(){
      //   this.customMoneyShow=true
      //
      // },

    },
//   components: {
//     AppHeader
//   }
  }
</script>

<style lang="scss" scoped>
  .home{
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0px;
    background-color: #eee;
    text-align: left;
  }
  #indexQukuanedu{
    width: 100%;
    height: auto;
    margin: auto;
  }
  header{
    width: 100%;
    height: auto;
    /*height: 3rem;*/
    display: flex;
    justify-content: space-between;
    //padding: 1rem;
    background: white;
    border-bottom: 1px solid #e3e3e3;
    padding:0.5rem 0 0.5rem 0;
    img{
      width: 1.4rem;
      height: 2rem;
      padding: 0.4rem;
      margin-left: 1rem;
    }
    p{
      font-size: 1.8rem;
      color: #333333;
      text-align: center;
      position: relative;
      left: 1rem;
    }
    img:nth-child(3){
      width: 2rem;
      height: 2rem;
      position: relative;
      left: 2rem;
    }
  }
  .AvailableCredit{
    width: 100%;
    background: white;
    margin: auto;
    .AvailableCredit_infor{
      width: 90%;
      list-style: none;
      padding-bottom: 1rem;
      border-bottom: 1px solid #e3e3e3;
      margin: auto;
      p:nth-child(1){
        font-size: 1.3rem;
        height: 2rem;
        line-height: 2rem;
        padding: 1rem 0 1rem 0;
        color: #999999;
      }
      p:nth-child(2){
        font-size: 3.2rem;
        font-family: PingFangSC-Semibold;
      }

    }
    #TotalAmount{
      width: 90%;
      margin: auto;
      p{
        /*height: 4rem;*/
        /*line-height: 4rem;*/
        font-size: 1.3rem;
        color: #666666;
        padding: 1rem 0 1rem 0;
      }
    }
  }
  .ApplicationLimitMomey{
    width: 100%;
    height: auto;
    background: white;
    /*border: 1px solid;*/
    margin-top: 1rem;
    ul{
      width: 96%;
      list-style: none;
      display: flex;
      justify-content: space-between;
      li{
        width: 100%;
        height: auto;
        /*height: 6rem;*/
        padding: 1rem;
        //line-height: ;
      }
      li:nth-child(1){
        p:nth-child(1){
          font-size: 1.5rem;
          font-family: "黑体";
          font-weight: 700;
          margin-bottom: 0.4rem;
          margin-top: 0.6rem;
        }
        p:nth-child(2){
          font-size: 1.2rem;
          color: #666;
          font-weight: 200;
        }
      }
      li:nth-child(2){
        //overflow: hidden;
        p{
          width: 100%;
          height: 100%;
          line-height: 4rem;
          padding-top:0.5rem;
          color: #333333;
          //border: 1px solid;
          font-size: 1.3rem;
          overflow: hidden;
          img{
            width: 1.2rem;
            height: 1.5rem;
            display: block;
            //border: 1px solid;
            margin-top: 1rem;
            float: right;
            //margin-right: 2rem;
          }
        }

      }
    }
  }

  #divs{
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    position: absolute;
    left: 0;
    top: 0;

    .ShowWarn{
      width: 86%;
      height:15rem;
      background: white;
      /*border: 1px solid red;*/
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      border-radius: 1rem;
      p:nth-child(1){
        font-size: 2rem;
        font-weight: 700;
        text-align: center;
        padding: 1rem 0 1rem 0;
      }
      p:nth-child(2){
        font-size: 1.3rem;
        text-align: center;
        padding: 2rem 0 1rem 0;
      }
      p:nth-child(3){
        width: 100%;
        height: 2rem;
        line-height: 2rem;
        border-top: 1px solid #cccccc;
        font-size: 1.3rem;
        text-align: center;
        padding: 1rem 0 1rem 0;
        position: absolute;
        bottom: 0;
        left: 0;
        color: #528CE0;
      }

    }
  }
</style>
